<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  

  
  <title>搭建 sven 服务器记录 | ZHB&#39;s Blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="sven 是 hl 的一个 mod，可以多人联机打怪或对战。 本文使用的服务器为阿里云的 VPS，安装的系统为 Ubuntu 16.04。  官方安装教程：Sven Co-op Manual :: Running a server (basic installation)">
<meta name="keywords" content="Linux,Games">
<meta property="og:type" content="article">
<meta property="og:title" content="搭建 sven 服务器记录">
<meta property="og:url" content="https://gkzhb.github.io/2019/02/sven/index.html">
<meta property="og:site_name" content="ZHB&#39;s Blog">
<meta property="og:description" content="sven 是 hl 的一个 mod，可以多人联机打怪或对战。 本文使用的服务器为阿里云的 VPS，安装的系统为 Ubuntu 16.04。  官方安装教程：Sven Co-op Manual :: Running a server (basic installation)">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2019-06-23T09:24:11.515Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="搭建 sven 服务器记录">
<meta name="twitter:description" content="sven 是 hl 的一个 mod，可以多人联机打怪或对战。 本文使用的服务器为阿里云的 VPS，安装的系统为 Ubuntu 16.04。  官方安装教程：Sven Co-op Manual :: Running a server (basic installation)">
  
    <link rel="alternate" href="/atom.xml" title="ZHB&#39;s Blog" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link rel="stylesheet" href="/css/sourcecodepro.css">
    <!-- <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css"> -->
  
  <link rel="stylesheet" href="/css/style.css">
</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">ZHB&#39;s Blog</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://gkzhb.github.io"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-sven" class="article article-type-post" itemscope itemprop="blogPost">



  <div class="article-meta">
    <a href="/2019/02/sven/" class="article-date">
  <time datetime="2019-02-14T16:00:00.000Z" itemprop="datePublished">2019-02-15</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Self-hosting/">Self-hosting</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      搭建 sven 服务器记录
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
		<!-- Table of Contents -->
		
			<div id="toc" class="toc-article">
				<strong class="toc-title">Table of Content</strong>
				<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#安装-steamcmd"><span class="toc-number">1.</span> <span class="toc-text">安装 steamcmd</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#安装-sven"><span class="toc-number">2.</span> <span class="toc-text">安装 sven</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#运行-sven-服务器"><span class="toc-number">3.</span> <span class="toc-text">运行 sven 服务器</span></a></li></ol>
			</div>
		
        <p>sven 是 hl 的一个 mod，可以多人联机打怪或对战。</p>
<p>本文使用的服务器为阿里云的 VPS，安装的系统为 Ubuntu 16.04。</p>
<ul>
<li>官方安装教程：<a href="http://www.svencoop.com/manual/server-basic.html" target="_blank" rel="noopener">Sven Co-op Manual :: Running a server (basic installation)</a></li>
</ul>
<a id="more"></a>
<h2 id="安装-steamcmd">安装 steamcmd</h2>
<ul>
<li>官方文档：<a href="https://developer.valvesoftware.com/wiki/SteamCMD" target="_blank" rel="noopener">SteamCMD - Valve Developer Community</a></li>
</ul>
<p>steamcmd 可以用来下载 steam 上许多游戏的服务端软件。安装过程同官方文档，注意先安装依赖，过程略。</p>
<h2 id="安装-sven">安装 sven</h2>
<p>安装好 steamcmd 后，可以通过命令运行它：<code>./steamcmd.sh</code> （如果按照文档的命令安装，就不要运行这条命令了）。</p>
<p>待出现 <code>Steam&gt;</code> 字样后 steamcmd 便已启动完成，可以输入命令安装 sven 了。</p>
<p>安装命令在 sven 文档中也已提供：<code>steamcmd +login anonymous +force_install_dir "C:\SvenDS" +app_update 276060 validate +exit</code>，这条命令<strong>好象</strong>直接在终端运行就好了，不需要打开 steamcmd，<strong>我没试过</strong>。</p>
<p>我个人是打开 steamcmd 后依次执行命令安装的，安装的时候没注意到 sven 已经提供了命令。我在 steamcmd 中输入的命令与文档提供的命令差不多，就是按照 <code>+</code> 把一条命令拆分成多个命令。每个 <code>+</code> 后面的命令都依次执行了一遍，也就是：<code>login anonymous</code> <code>force_install_dir [安装路径]</code> <code>app_update 276060 validate</code> <code>exit</code>。执行完最后一条 <code>exit</code> 命令 steamcmd 也就关闭了。注意以上命令是在 steamcmd 中输入的，不是在终端中输入。</p>
<h2 id="运行-sven-服务器">运行 sven 服务器</h2>
<p>安装完后，参考官方文档提供的参数，启动服务器：<code>./svends_run -console -port 27015 +maxplayers 12 +map [地图] +log on</code></p>
<p>刚开始启动的时候报错</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory</span><br></pre></td></tr></table></figure>
<p>安装 <code>lib32stdc++6</code> 解决了这个问题：<code>apt-get install lib32stdc++6</code></p>
<p>之后又有新的问题：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">libssl.so.1.1: cannot open shared object file: No such file or directory</span><br></pre></td></tr></table></figure>
<p>这个问题要安装 <code>libssl1.1:i386</code> 才能解决。我在这里折腾了很久才最终成功。先是安装了 openssl1.1 然后装了这个，最后成功运行服务器。同时要注意的是防火墙要开启三个端口：<code>27015 UDP</code> <code>27015 TCP</code> <code>26900 UDP</code>。</p>
<ul>
<li>链接：
<ul>
<li><a href="https://stackoverflow.com/questions/41887754/why-apt-get-install-openssl-did-not-install-last-version-of-openssl" target="_blank" rel="noopener">ubuntu 16.04 - Why 'apt-get install openssl' did not install last version of OpenSSL? - Stack Overflow</a></li>
<li><a href="https://askubuntu.com/questions/638933/utorrent-server-libssl-so-1-0-0-wrong-elf-class-elfclass64" target="_blank" rel="noopener">utorrent server, libssl.so.1.0.0: wrong ELF class: ELFCLASS64 - Ask Ubuntu</a></li>
</ul></li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://gkzhb.github.io/2019/02/sven/" data-id="cjx8qwkwg0006pqw8ahj3sle2" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Games/">Games</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Linux/">Linux</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/02/spring/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          Spring 入门笔记
        
      </div>
    </a>
  
  
    <a href="/2019/01/hexo/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">Hexo 博客搭建折腾记录</div>
    </a>
  
</nav>

  
</article>


</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Landscape/">Landscape</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Linux/">Linux</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Programming/">Programming</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Self-hosting/">Self-hosting</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Software/">Software</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Anki/">Anki</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Blog/">Blog</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Command-Line/">Command Line</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Data-Structure/">Data Structure</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Games/">Games</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Hometown/">Hometown</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Linux/">Linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Network/">Network</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Read-It-Later/">Read-It-Later</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Recall/">Recall</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Regular-Expression/">Regular Expression</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Server/">Server</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Spring/">Spring</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/折腾/">折腾</a></li></ul>
    </div>
  </div>


  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2019 Haibin Zhang<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> -->

<!-- <script src="http://apps.bdimg.com/libs/jquery/2.0.3/jquery.min.js"></script> -->
<script src="/mathjax/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<script src="/js/jquery.min.js"></script>

  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>




  </div>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
		messageStyle: "none",
		showProcessingMessages: false,
        tex2jax: {
            inlineMath: [ ["$","$"], ["\\(","\\)"] ],
            skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'],
            processEscapes: true
        }
    });
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax();
        for (var i = 0; i < all.length; ++i)
            all[i].SourceElement().parentNode.className += ' has-jax';
    });
</script>
<!-- <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> -->
<script src="/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

</body>
</html>